<template>
  <div class="ee">
    <a-form :form="form">
      <a-form-item label="补货时间" :label-col="{ span: 3}" :wrapper-col="{ span: 16, offset: 1}">
        {{ this.$store.state.replenishmentTime }}
        <!-- replenishmentTime:this.$store.state.replenishmentTime,
        posAddr:this.$store.state.posAddr-->
      </a-form-item>
      <a-form-item
        label="待补货设备"
        :label-col="{ span: 3}"
        :wrapper-col="{ span: 16, offset: 1}"
      >{{ this.$store.state.devCode }}</a-form-item>
      <a-form-item
        label="待补货设备地址"
        :label-col="{ span: 3}"
        :wrapper-col="{ span: 16, offset: 1}"
      >{{ this.$store.state.posAddr }}</a-form-item>
      <a-form-item label="回货单商品详情" :label-col="{ span: 3}">
        <!-- //进行下面的表格操作 -->
        <a-table
          class="tb"
          :columns="columns"
          :dataSource="data"
          :bordered="true"
          :pagination="false"
          :rowKey="record => record.goodsId"
        >
          <template slot="name" slot-scope="text" href="javascript:;">{{text}}</template>
        </a-table>
        <!-- //进行下面的表格操作 -->
      </a-form-item>
    </a-form>
    <a-row>
      <a-col style="text-align:right">
        <router-link to="/home/repertoryadmin/backinvoice">
          <a-button>返回</a-button>
        </router-link>
      </a-col>
    </a-row>
  </div>
</template>

<script>
const columns = [
  {
    //dataindex是用来渲染数据的
    dataIndex: "goodsName",
    title: "商品名称",
    align: "center"
    // scopedSlots: { customRender: "name" }
  },
  {
    dataIndex: "inboundNum",
    title: "数量",
    align: "center"
  }
];
const data = [
  {
    key: "1"
  }
];
export default {
  data() {
    return {
      expand: false,
      //上面绑定了form表单所以后面用this.creatform
      form: this.$form.createForm(this),
      //分页的方法
      pagination: {
        //是否可以改变pagesize
        showSizeChanger: true,
        //是否可以快速条状某页数
        showQuickJumper: true,
        //每一页可以显示多好条数
        pageSizeOptions: ["2", "4", "8", "10", "12"],
        //用于显示数据总量和当前数据的顺序
        showTotal: (total, range) => {
          return `${range[0]}-${range[1]} 共${total}条`;
        },
        pageSize: 5,
        defaultCurrent: 1,
        current: 1,
        total: 500
      },
      data: [],
      columns,
      replenishmentTime: ""
    };
  },
  methods: {
    backdetail() {
      var values = this.form.getFieldsValue();
      // console.log(values);

      this.axios
        .post(this.baseUrl + "/inboundOrder/detailInboundList", {
          loginToken: this.$store.state.loginToken,
          inboundOrderId: this.$store.state.inboundOrderId,
          replenishmentOrderId: this.$store.state.replenishmentOrderId
        })
        .then(response => {
          //成功后的回调函数
          console.log(response.data);
          this.data = response.data.data;
          //总条数-每一页的条数-当前的数
        })
        .catch(error => {
          console.log(error);
        });
    }
  },
  created() {
    this.backdetail();
  }
};
</script>

<style >
.ee {
  padding-left: 40px;
}
p {
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.850980392156863);
  line-height: 22px;
}
</style>
